char* addBinary(char* a, char* b)
{
    int l1 = strlen(a), l2 = strlen(b);
    int len = l1 > l2 ? l1 : l2;
    int n1 = l1 - 1, n2 = l2 - 1;
    char* str = (char*)calloc(len + 2, sizeof(char));
    for (int i = len; i > 0; i--)
    {
        int x, y;    x = y = 0;
        if (n1 >= 0)
            x = a[n1] - '0';
        if (n2 >= 0)
            y = b[n2] - '0';
        n1--, n2--;
        int tmp = x + y;
        if (str[i] == '1')
            tmp++;
        if (tmp >= 2)
        {
            str[i] = tmp % 2 + '0';
            str[i - 1] = '1';
        }
        else
            str[i] = tmp + '0';
    }
    if (str[0] == '1')
        return str;
    else
        return str + 1;
    return 0;
}